package mlz.d_javabean;

//测试类
public class PersonDemo01 {
    public static void main(String[] args) {
        //新建Person对象
        Person p1 = new Person();
        method01(p1);

        Person person = method02();
        System.out.println(person);

//        PersonDemo01 demo01 = new PersonDemo01();
//        Person person = demo01.method02();
//        System.out.println(person);
    }

    //引用类型作为方法的参数使用
    public static void method01(Person p){
        p.eat();
    }

    //引用类型作为方法的返回值使用
    public static Person method02(){
        //新建一个对象
        Person person = new Person();
        //调用类中的成员方法
        person.eat();
        return person;
//        return new Person();
    }
    public int[] m2(){
        int[] arr  = new int[]{11,22,33};
        return arr;
    }

    public int m1(){
        return 10;
    }


}
